package com.dcrzl.shcz.module.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.dcrzl.shcz.common.entity.sys.SysRoleUnit;
import com.dcrzl.shcz.common.mapper.sys.SysRoleUnitMapper;
import com.dcrzl.shcz.common.service.impl.BaseServiceImpl;
import com.dcrzl.shcz.common.utils.PageInfo;
import com.dcrzl.shcz.common.utils.Result;
import com.dcrzl.shcz.common.utils.SysConstant;
import com.dcrzl.shcz.module.sys.service.SysRoleUnitService;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service("sysRoleUnitService")
public class SysRoleUnitServiceImpl extends BaseServiceImpl<SysRoleUnitMapper, SysRoleUnit> implements SysRoleUnitService {


    @Override
    public Result<SysRoleUnit> selectOne(SysRoleUnit sysRoleUnit) {
        LambdaQueryWrapper<SysRoleUnit> wrapper = new LambdaQueryWrapper<>();
        return super.selectOne(wrapper);
    }

    @Override
    public Result<List<SysRoleUnit>> selectList(SysRoleUnit sysRoleUnit) {
        LambdaQueryWrapper<SysRoleUnit> wrapper = new LambdaQueryWrapper<>();
        return super.selectList(wrapper);
    }

    @Override
    public PageInfo<SysRoleUnit> selectPage(SysRoleUnit sysRoleUnit) {
        LambdaQueryWrapper<SysRoleUnit> wrapper = new LambdaQueryWrapper<>();
        return super.selectPage(sysRoleUnit, wrapper);
    }

    @Override
    public Result<Integer> removeById(Serializable id) {
        SysRoleUnit sysRoleUnit = new SysRoleUnit().setStatus(SysConstant.DATA_DELETE_STATUS)
                .setId((Long) id);
        return this.updateById(sysRoleUnit);
    }

}